package com.ruoyi.lxy.controller;

import com.alibaba.druid.support.json.JSONUtils;
import com.ruoyi.camera.domain.AiCamera;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.lxy.domain.HwmxDomain;
import com.ruoyi.lxy.service.LxyService;
import com.ruoyi.lxy.service.StoreService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

import static org.apache.naming.SelectorContext.prefix;

@Controller
@RequestMapping("/store")
public class StoreController extends BaseController {


    private String prefix = "/store";

    @Autowired
    private LxyService lxyService;


    @PostMapping("/list")
    @ResponseBody

    public AjaxResult list()
    {
//        startPage();
        List<HwmxDomain> list = lxyService.listStore();
//        JSONUtils.toJSONString(list)
        return AjaxResult.success(list);
    }

//    @RequiresPermissions("AI:cameraB:view")
@RequiresPermissions("store:view")
    @GetMapping()
    public String camera()
    {
        return prefix + "/list";
    }
}
